package ro.isdc.navigator.factory;

import ro.isdc.navigator.IPagesNavigator;
import ro.isdc.navigator.impl.PagesNavigator;

/**
 * Pages navigator factory implementation.
 * 
 * @author Andrei Chirila / ISDC! Romania
 * @version 1.0
 * @date Jul 1, 2009 
 * @param <T> 
 */
public class PagesNavigatorFactory<T> implements IPagesNavigatorFactory<T> {
  
  /**
   * {@inheritDoc}
   */
	public IPagesNavigator<T> createPagesNavigator(final SearchContext searchContext) {
	  PagesNavigator<T> pagesNavigator = getPagesNavigator();
	  pagesNavigator.setSearchContext(searchContext);
	  
	  return pagesNavigator;
	}
	
	/**
	 * @return a pages navigator. Method injected by Spring.
	 */
	protected PagesNavigator<T> getPagesNavigator() {
	  throw new RuntimeException("PagesNavigator is injected by Spring");
	}
}
